<template>
  <div class="tableModel-pags">
    <div class="tableModel-content">
        <div class="InventoryManage-page-nav">
            <el-tabs
              v-model="types" v-if="menuItem.length > 0" @change="parentMethod" 
              class="custom-tabs"
              >
              <el-tab-pane
              v-for="tab in menuItem"
              :key="tab.perms"
              :label="tab.menuName"
              :name="tab.perms"
              >
              </el-tab-pane>
          </el-tabs> 
        </div>
        <div class="tableModel-content-table"> 
          <ghTable v-if="types == 'statistics-performance-gh'"></ghTable>
          <sfTable v-if="types == 'statistics-performance-sf'"></sfTable>
          <mzTable v-if="types == 'statistics-performance-mz'"></mzTable>
          <jyTable v-if="types == 'statistics-performance-jy'"></jyTable>
          <jcTable v-if="types == 'statistics-performance-jc'"></jcTable>
          <zxTable v-if="types == 'statistics-performance-zx'"></zxTable>
          <yfTable v-if="types == 'statistics-performance-yf'"></yfTable>
        </div>
    </div>
  </div>
</template>
<script setup lang="ts">
  import ghTable from './ghTable.vue';
  import sfTable from './sfTable.vue';
  import mzTable from './mzTable.vue';
  import jyTable from './jyTable.vue';
  import jcTable from './jcTable.vue';
  import zxTable from './zxTable.vue';
  import yfTable from './yfTable.vue';
  const list = ref<any>(['挂号统计','收费统计','门诊统计','检验统计','检查统计','执行统计','药房统计'])
  //获取菜单
  import stores from '@/store';
 
  const route = useRoute();
  // let menuItem = ref<any>( await stores.useBaseDataStore().findMenuList(route.query.submenuId));
  // for (let index = 0; index < menuItem.value.length; index++) {
  //   if (menuItem.value[index].menuName == '挂号统计') {
  //     list.value.push('挂号统计');
  //   }else if (menuItem.value[index].menuName == '收费统计') {
  //     list.value.push('收费统计');
  //   }else if (menuItem.value[index].menuName == '门诊统计') {
  //     list.value.push('门诊统计');
  //   }else if (menuItem.value[index].menuName == '检验统计') {
  //     list.value.push('检验统计');
  //   }else if (menuItem.value[index].menuName == '检查统计') {
  //     list.value.push('检查统计');
  //   }else if (menuItem.value[index].menuName == '执行统计') {
  //     list.value.push('执行统计');
  //   }else if (menuItem.value[index].menuName == '药房统计') {
  //     list.value.push('药房统计');
  //   }
  // }
  
    //菜单权限
  let menuList = ref<any>( await stores.useBaseDataStore().findMenuList(route.query.submenuId));
  
  menuList.value.filter((item:any) => {
      return  item.menuType == 2;
  })
  let menuItem = ref<any>(menuList.value);
  //console.log(menuItem.value,'route.query.submenuId');

  const types = ref<string>(); // 默认选中标签
  if (menuItem.value.length > 0) {
    types.value = menuItem.value[0].perms;
  }

  const parentMethod = (e: any) => {
    types.value = e;
  };
  onMounted(() => {
  });
</script>
<style scoped lang="scss">
  ::v-deep(.el-tabs__item) {
    width: 110px !important; /* 设置每个tab的宽度 */
    padding: 0 !important; /* 去除默认padding */
    font-size: 16px !important; /* 设置字体大小 */
    margin: 0;
    }
    ::v-deep(.el-tabs__nav-wrap:after){
        height: 1px !important;
    }
  .tableModel-pags { 
        padding: 10px 24px 20px;

     .tableModel-content{
      background-color: #fff;

    }
    .tableModel-pags-content {
      background-color: #fff;
    }
   
  }
</style>